package com.sweetguy.dto;

import com.sweetguy.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Schema(name = "用户登录DTO" , description = "通过账号密码登录")
@Data
public class LoginByAccountDTO implements Serializable, RE {

    @NotEmpty(message = "账号不能为空")
    @Pattern(regexp = USERNAME_RE, message = USERNAME_RE_MSG)
    @Schema(description = "账号")
    private String username;

    @NotEmpty(message = "密码不能为空")
    @Pattern(regexp = PASSWORD_RE, message = PASSWORD_RE_MSG)
    @Schema(description = "密码")
    private String password;
}
